package com.manning.s2ip.interceptors;

import com.manning.s2ip.beans.ImportantBean;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class ImportantMessageLogger extends MethodFilterInterceptor {

	private ImportantBean importantBean;
	
	@Override
	protected String doIntercept(ActionInvocation invocation) throws Exception {
		log.info(importantBean.getImportantMessage());
		return invocation.invoke();
	}

	public void setImportantBean(ImportantBean importantBean) {
		this.importantBean = importantBean;
	}

}
